<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/11/13
 * Time: 13:39
 */

namespace Modules\Api\Http\Controllers;

use Illuminate\Http\Request;
use Modules\Api\Service\InvoiceService;

class InvoiceController extends BaseController
{

	/**
	 *	获取发票信息
	 *	hinq 2019 11 19
	 *	
	 **/
	public function invoice_info(){
		$arr_list = InvoiceService::get_one();		
		return response_json( $arr_list );
	}


	/**
	 *	添加发票信息
	 *	hinq 2019 11 19
	 *
	 **/
	public function store_invoice( Request $request ){
		$arr_input = (array) $request->all();
		$arr_list = InvoiceService::add_one( (array) $arr_input );		
		return response_json( $arr_list );
	}

	/**
	 *	添加发票信息
	 *	hinq 2019 11 19
	 *  满足多店铺同时申请发票
	 **/
	public function apply_invoice( Request $request ){
		$arr_input = (array) $request->all();
		$arr_list = InvoiceService::apply_invoice( (array) $arr_input );		
		return response_json( $arr_list );
	}

    /**
     *	获取需要打印发票的订单
     *	hinq 2019 11 21
     *
     **/
    public function invoice_order( Request $request ){
        $arr_input = (array) $request->all();
        $arr_list = InvoiceService::invoice_order( (array) $arr_input );
        return response_json( $arr_list );
    }

    /**
     *  获取用户申请的发票列表
     *  hinq 2020 5 8
     *
     **/
    public function apply_list( Request $request ){
        $arr_input = (array) $request->all();
        return InvoiceService::apply_list( (array) $arr_input );
    }

}